|
|
|
|
|
|
|
Figure 15.4.
The results of the INSERT INTO_FROM statement with the IN clause. |
|
|
|
|
|
|
|
|
The script in Listing 15.4 first creates a database with a single table (OtherTitles) that has two records in the table. Then the script displays the table for a moment before the database is closed. Notice that the records in the table have OtherTitles.JobCounter values of 1 and 2. Then the script creates the JobTitles table in another database and populates that table with three records. Other tables are populated (this was done in previous examples), and eventually the JobTitles table is displayed. The three records have JobTitles.JobCounter values of 1, 2, and 3. Finally, the INSERT INTO_FROM_IN statement is executed to update the external data table. Then the external table is opened so that you can view the results. |
|
|
|
|
|
|
|
|
Now look at the OtherTitles.JobCounter values. What has happened? When you append COUNTER data fields to another table, the new records are renumbered. This ensures unique counter values in the table. If you want to retain the old numbers, you can include the COUNTER field in your INSERT INTO list. To illustrate this, add the JobCounter column name to the field list in the INSERT INTO statement that updated the external table (see Figure 15.5). Now execute the script again to see the results. |
|
|
|
|
|
|
|
|
Figure 15.5.
The results of the INSERT INTO_FROM_IN with an updated counter column. |
|
|
|
|
|